package com.mycloud.core.service;

import com.mycloud.core.model.IdentifiableEntity;
import org.hibernate.ObjectNotFoundException;

/**
 * User: hossein bahramian
 * Date: Sep 27, 2011
 * Time: 8:32:27 PM
 */
public interface GenericService {

    public void persist(IdentifiableEntity object);

    public <T> T read(Class<T> clazz, Long key) throws ObjectNotFoundException;

    public <T> T readByName(Class<T> clazz, String name) throws ObjectNotFoundException;

    public <T> Long readIdByName(Class<T> clazz, String name) throws ObjectNotFoundException;

    public void delete(Object object);

}
